package wql.demo03;

/**
 * @author wql
 * @version 1.0
 * @date 2022/10/25 14:25
 */

public class All {
    public static void main(String[] args) {
        Hai<Integer> hai = new Hai<>();
        hai.setE(123);
        gone(hai);

        Hai<String> hai1 = new Hai<>();
        hai1.setE("好饿");
        gone(hai1);
    }
    public static void gone(Hai<?>hai){
            hai.eat();
    }
}
class  Hai<T>{
    private T e;
    public void  eat(){
        System.out.println("e = " + e);
    }

    public T getE() {
        return e;
    }

    public void setE(T e) {
        this.e = e;
    }

    @Override
    public String toString() {
        return "Hai{" +
                "e=" + e +
                '}';
    }
}
